define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'knscy.infos/index',
        add_url: 'knscy.infos/add',
        edit_url: 'knscy.infos/edit',
        delete_url: 'knscy.infos/delete',
        export_url: 'knscy.infos/export',
        modify_url: 'knscy.infos/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'ID'},
                    {field: 'sort', title: '排序',search: false, edit: 'text'},
                    {field: 'type_id', search: 'select', selectList: ["自定义","购买须知","限购说明","使用说明","费用说明","产品详情","改退规则","发票说明","入园须知"], title: '类型'},

                    {field: 'title', title: '标题名称',minWidth:200},

                    {field: 'status', search: 'select', selectList: ["禁用","启用"], title: '状态', templet: ea.table.switch},
                    {field: 'create_time', title: '创建时间',search:'range',minWidth:200},
                    {fixed:"right",width: 150, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});